package com.dg.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.dg.dao.impl.BaseDaoImpl;
import com.dg.service.BaseGenericityService;

@Service(value="genericityService")
public class BaseGenericityServiceImpl<T,ID> implements BaseGenericityService<T, ID> {

	@Resource(name="baseDao")
	private BaseDaoImpl<T, ID> dao;
	
	public Integer save(String sql,T entity) {
		return dao.save(sql, entity);
	}
	
	public Integer update(String sql,T entity) {
		return dao.update(sql, entity);
	}
	
	public Integer delete(String sql,T entity) {
		return dao.save(sql, entity);
	}
	
	public List<T> findAll(String sql,ID id) {
		return dao.findAll(sql, id);
	}
	
	public T findOne(String sql,ID id) {
		return dao.findOne(sql, id);
	}

}
